<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/commons/taglibs.jsp"%>
<div class="tabs"  eventType="click" >
    <div class="tabsHeader">
        <div class="tabsHeaderContent">
            <ul>
                <li><a href="javascript:;"><span>此节点信息</span></a></li>
                <li><a href="javascript:;"><span>新增子节点</span></a></li>
                <li><a href="javascript:;"><span>子节点排序</span></a></li>
            </ul>
        </div>
    </div>
    <div class="tabsContent" layoutH="92" >
        <div class="pageContent">
            <form:form modelAttribute="category"  action="${ctx}/category/edit?navtabid=categoryNav" method="post"   onsubmit="return validateCallback(this, dialogAjaxDone);" >
                <div class="pageFormContent nowrap" layoutH="158">
                    <input type="hidden" id="id" name="id" value="${category.id}"/>
                    <input type="hidden"  name="pid" value="${category.pid}"/>
                    <dl>
                        <dt>产品类别：</dt>
                        <dd>
                            <input type="text" name="name" class="required"  value="${category.name}"/>
                            <span class="info">产品类别名称</span>
                        </dd>
                    </dl>
                    <dl>
                        <dt>索引值：</dt>
                        <dd>
                            <input type="text" name="indexs" class="digits required"  value="${category.indexs}" />
                            <span class="info">排序索引值</span>
                        </dd>
                    </dl>
                </div>
                <div class="formBar">
                    <ul>
                        <li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li>


                        <li><div class="button"><div class="buttonContent"> <a  href="${ctx}/category/delete/${category.id}?navtabid=categoryNav"
                                                                                target="ajaxTodo" title="确定要删除${category.name}吗?"  ><button type="button" >删除</button></a></div></div></li>
                    </ul>
                </div>
            </form:form>
        </div>
        <div class="pageContent">
            <form:form modelAttribute="category"  action="${ctx}/category/add?navtabid=categoryNav" method="post"   onsubmit="return validateCallback(this, dialogAjaxDone);" >
                <div class="pageFormContent nowrap" layoutH="158">
                    <input type="hidden"  name="pid" value="${category.id}"/>
                    <div>父节点名称： ${category.name}</div>
                    <dl>
                        <dt>产品类别：</dt>
                        <dd>
                            <input type="text" name="name" class="required" />
                            <span class="info">产品类别名称</span>
                        </dd>
                    </dl>
                    <dl>
                        <dt>索引值：</dt>
                        <dd>
                            <input type="text" name="indexs" class="digits required" />
                            <span class="info">排序索引值</span>
                        </dd>
                    </dl>
                </div>
                <div class="formBar">
                    <ul>
                        <li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li>
                    </ul>
                </div>
            </form:form>
        </div>
        <div class="pageContent">
            <c:if test="${fn:length(list)>0}">
                <form:form modelAttribute="list"  action="${ctx}/category/eidtindexs?navtabid=categoryNav" method="post"   onsubmit="return validateCallback(this, dialogAjaxDone);" >
                 <table   class="table" width="100%" layoutH="158">
                    <thead>
                    <tr>
                        <th>id</th>
                        <th>name</th>
                        <th>pid</th>
                        <th>index</th>
                    </tr>
                    </thead>
                    <tbody>
                    <c:forEach var="item" items="${list}" varStatus="menu">
                        <tr>
                            <td>${item.id}</td>
                            <td>${item.name}</td>
                            <td>${item.pid}</td>
                            <td><input  name="indexs"  value="${item.indexs}"></td>
                        </tr>
                    </c:forEach>
                    </tbody>
                   </table>

                <div class="formBar">
                    <ul>
                        <li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li>
                    </ul>
                </div>
                </form:form>
            </c:if>
            <c:if test="${list== null || fn:length(list) == 0}">
                    无任何子节点信息
            </c:if>
        </div>
    </div>
    <div class="tabsFooter">
        <div class="tabsFooterContent"></div>
    </div>
</div>